package router

import (
	"github.com/gin-gonic/gin"
	"lin6xcom/src/controller"
	"lin6xcom/src/utils"
)

// 文章相关路由
func articleRouter(e *gin.Engine) {
	articleGroup := e.Group("/article")
	{
		articleGroup.GET("get", controller.ArticleController{}.GetArticle)
		articleGroup.GET("getAll", controller.ArticleController{}.GetAllArticle)
		articleGroup.GET("getOfUser", controller.ArticleController{}.GetUserAllArticle)
		//以下需要登录
		articleGroup.POST("add", utils.FJwt{}.Getting, controller.ArticleController{}.AddArticle)
		articleGroup.PUT("update", utils.FJwt{}.Getting, controller.ArticleController{}.UpdateArticle)
		articleGroup.DELETE("delete", utils.FJwt{}.Getting, controller.ArticleController{}.DeleteArticle)
	}

}
